import request from '@/utils/request.js'

//查询搜索
export function getSearch(data) {
  return request({
    url: '/clues/list',
    method: 'post',
    data
  })
}

//新建线索
export function setClue(data) {
  return request({
    url: '/clues/add',
    method: 'post',
    data
  })
}

//线索分配
export function allocationClue(data) {
  return request({
    url: '/clues/allocation',
    method: 'put',
    data
  })
}

//部门查询
export function getDepartment() {
  return request({
    url: '/system/dict/data/type/sys_department'
  })
}

//人员查询
export function getUser() {
  return request({
    url: '/system/dict/data/type/sys_user'
  })
}

/* 线索池 */
//线索搜索
export function getCuleData(data) {
  return request({
    url: '/clues/cluepool_list',
    method: 'post',
    data
  })
}

//线索捞取
export function setClueList(data) {
  return request({
    url: '/clues/cluepool_gain',
    method: 'put',
    data
  })
}

/* 线索跟进 */
//线索详情
export function clueInfo(id) {
  return request({
    url: `/clues/follow_list/?clueId=${id}`
  })
}

//添加跟进
export function addFollow(data) {
  return request({
    url: '/clues/follow_add',
    method: 'post',
    data
  })
}

//线索上报
export function setClueEscalation(data) {
  return request({
    url: '/clues/spurious_clue',
    method: 'put',
    data
  })
}

//转商机
export function updateBusiness(id) {
  return request({
    url: `/clues/change_business/?clueId=${id}`
  })
}

//操作记录
export function operating_record(id) {
  return request({
    url: `/clues/operating_record/?clueId=${id}`
  })
}
